package com.hzcc.hzccblog.common.enums;

import com.hzcc.hzccblog.common.Result;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Author 早睡蛋
 * @Date 2022/6/9 18:15:23
 * @Desc:
 */
@Getter
@AllArgsConstructor
public enum ExceptionEnums {

    IDisEXIST(4501,"id重复"),
    DATABASEERROR(4502,"数据库连接失败"),
    CONNECTEXCEPTION(4503,"连接失败"),
    NullPointerException(4504,"空值"),


    ;

    ExceptionEnums(int code, String message) {
        this.result =  Result.defaultResultResponse();
        result.setCode(code);
        result.setMessage(message);
    }

    public int getCode(){
        return result.getCode();
    }

    public String getMessage(){
        return result.getMessage();
    }

    public Result getResult() {
        return result;
    }


    private final Result result;

}
